package pure.engine.core
{
	import flash.display.BitmapData;
	import flash.events.EventDispatcher;
	import flash.filters.BitmapFilter;
	import flash.geom.Point;
	import pure.debug.Logger;
	
	use namespace ns_despair;
	
	/// @eventType	pure.engine.events.InteractEvent.CLICK
	[Event(name="click", type="pure.engine.events.InteractEvent")] 

	/// @eventType	pure.engine.events.InteractEvent.PRESS
	[Event(name="press", type="pure.engine.events.InteractEvent")] 

	/// @eventType	pure.engine.events.InteractEvent.RELEASE
	[Event(name="release", type="pure.engine.events.InteractEvent")] 

	/// @eventType	pure.engine.events.InteractEvent.MOVE
	[Event(name="move", type="pure.engine.events.InteractEvent")] 

	/// @eventType	pure.engine.events.InteractEvent.OVER
	[Event(name="over", type="pure.engine.events.InteractEvent")] 

	/// @eventType	pure.engine.events.InteractEvent.LEAVE
	[Event(name = "leave", type = "pure.engine.events.InteractEvent")]
	
	
	/**
	 * 可视抽象类
	 * [Author] - PURE
	 * 
	 */
public class VisibleCore extends EventDispatcher implements IVisible
{
	
	
	
	//======================
	// Const
	//======================
	
	
	public static const ONE_EIGHTY_DIV_PI:Number  =  180 / Math.PI;
	public static const PI_DIV_ONE_EIGHTY:Number  =  Math.PI / 180;
	
	
	
	
	
	//======================
	// Property
	//======================
	
	
	/**
	 * 是否可交互
	 */
	public function get interactive():Boolean 
	{
		return m_interactive; 
	}
	
	public function set interactive(b:Boolean):void 
	{
		m_interactive = b; 
	}

	
	/**
	 * 弧度
	 * 
	 * [Hint] - 一般使用rotation属性.
	 */
	public function get angle():Number 
	{ 
		return m_rotation * PI_DIV_ONE_EIGHTY;
	}
	
	public function set angle(v:Number):void 
	{ 
		this.m_rotation = v * ONE_EIGHTY_DIV_PI;
	}
	
	
	/**
	 * 角度
	 * 
	 * [Hint] - 0 ~ 360
	 */
	public function get rotation():Number 
	{
		return m_rotation;
	}
	
	public function set rotation(v:Number):void 
	{
	}
	

	
	
	
	//======================
	// Base
	//======================
	
	
	/**
	 * 加入滤镜
	 * 
	 * [Param] - F  滤镜
	 */
	public function addFilter(F:BitmapFilter):void
	{
		(m_filterList ||= []).push(F);
	}
	
	
	/**
	 * 清空滤镜
	 */
	public function clearFilter():void
	{
		m_filterList = null;
	}


	

	/* ----------------------------------------------------------------------------------------------------------------
	 * ★★★★★★★★★★★★★★★★★★★★★  private  ★★★★★★★★★★★★★★★★★★★★★
	 * ----------------------------------------------------------------------------------------------------------------
	 */
	

	 
	/**
	 * 毁灭
	 */
	ns_despair function destroy():void
	{
		m_filterList = null;
	}
	
	
	
	
	
	//======================
	// Member
	//======================

	
	ns_despair var m_flags:int;  // 状态

	ns_despair var m_rotation:Number = 0;

	ns_despair var m_name:String;  // 名字

	ns_despair var m_interactive:Boolean = true;

	ns_despair var m_filterList:Array;  // 滤镜列表

	public var m_x:Number = 0;
	
	public var m_y:Number = 0;
	
	
}
}